package im.javaer.cloud.demo1.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wangzi
 * @version 1.0
 * @description 初始controller
 * @date 2019/10/28 09/41
 **/
@RestController
@Api(tags = "demo1文档")
public class DemoController {

    @Value("${config}")
    private String config;
    @Value("${aaa}")
    private String aaa;

    @RequestMapping(value = "demo", method = RequestMethod.GET)
    @ApiOperation("配置中心读取多配置文件测试")
    public Map demo() {
        Map<String, Object> map = new HashMap<>();
        map.put("status", 200);
        map.put("msg", "操作成功");
        map.put("config", config);
        map.put("aaa", aaa);
        return map;
    }


}